﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

[Serializable]
public class InitEquip
{
    public long id;
    public string name;
    /// <summary>
    /// 装备属性    
    /// </summary>
    public int value;
    /// <summary>
    /// 装备类型 , 1:武器，2:衣服 3:戒指 4:鞋子
    /// </summary>
    public int kind;
    /// <summary>
    /// 品质
    /// </summary>
    public int quality;
    public string info;

    public AttributeType GetAttributeType()
    {
        if (kind == 1)
        {
            return AttributeType.ATK;
        }
        else if (kind == 2)
        {
            return AttributeType.DEF;
        }
        else if (kind == 3)
        {
            return AttributeType.HP;
        }
        else
        {
            return AttributeType.RGS;
        }
    }
}

public class InitEquipMgr
{
    public static Dictionary<long, InitEquip> Dict { get; private set; }

    public static void Load()
    {
        List<InitEquip> initRoles = StaticDataReader.LoadJsonFromFile<InitEquip>("static_init_equip");
        if (initRoles != null)
        {
            Dict = new Dictionary<long, InitEquip>(initRoles.Count);
            for(int i=0; i<initRoles.Count; i++)
            {
                Dict.Add(initRoles[i].id, initRoles[i]);
            }
        }
        else
        {
            Dict = new Dictionary<long, InitEquip>();
        }
    }
}
